<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="./template/StakeholderTemplate.xhtml">
    <ui:define name="contentInsert">
        <h:body>
            <h:form>  

                <p:dataTable var="allFandB" value="#{reservationManagerBean.allFandB}" paginator="true" rows="15"  
                             selection="#{reservationManagerBean.selectedReservation}" selectionMode="single"  
                             onRowSelectUpdate="display" onRowSelectComplete="viewSelectedMeal?faces-redirect=true">  

                    <f:facet name="header">  
                        List of Reservation  
                    </f:facet>  

                    <p:column sortBy="#{allFandB.customer.name}" filterBy="#{allFandB.customer.name}">  
                        <f:facet name="header">  
                            <h:outputText value="Customer name" />  
                        </f:facet>  
                        <h:outputText value="#{allFandB.customer.name}" />  
                    </p:column>  

                    <p:column sortBy="#{allFandB.dateReserved}" filterBy="#{allFandB.dateReserved}">  
                        <f:facet name="header">  
                            <h:outputText value="Date Reserved" />  
                        </f:facet>  
                        <h:outputText value="#{allFandB.dateReserved}" />  
                    </p:column>  

                    <p:column sortBy="#{allFandB.timeBegin}" filterBy="#{allFandB.timeBegin}">  
                        <f:facet name="header">  
                            <h:outputText value="Time Begin" />  
                        </f:facet>  
                        <h:outputText value="#{allFandB.timeBegin}" />  
                    </p:column>  

                    <p:column sortBy="#{allFandB.timeEnd}" filterBy="#{allFandB.timeEnd}">  
                        <f:facet name="header">  
                            <h:outputText value="Time End" />  
                        </f:facet>  
                        <h:outputText value="#{allFandB.timeEnd}" />  
                    </p:column> 

                    <p:column sortBy="#{allFandB.customerStatus}" filterBy="#{allFandB.customerStatus}">  
                        <f:facet name="header">  
                            <h:outputText value="Customer Status" />  
                        </f:facet>  
                        <h:outputText value="#{allFandB.customerStatus}" />  
                    </p:column> 

                    <p:column sortBy="#{allFandB.confirmation}" filterBy="#{allFandB.confirmation}">  
                        <f:facet name="header">  
                            <h:outputText value="Reservation Confirmation" />  
                        </f:facet>  
                        <h:outputText value="#{allFandB.confirmation}" />  
                    </p:column> 

                </p:dataTable>  

                <p:dialog header="Reservation Detail" widgetVar="reservationDialog" resizable="false"  
                          width="600" showEffect="explode" hideEffect="explode">  

                    <h:panelGrid id="display" columns="2" cellpadding="10">  

                        <h:outputText value="Customer Name:" />  
                        <h:outputText value="#{reservationManagerBean.selectedReservation.customer.name}" />  

                        <h:outputText value="Reservation ID" />  
                        <h:outputText value="#{reservationManagerBean.selectedReservation.id}" />  

                        <h:outputText value="Customer Status:" />  
                        <h:outputText value="#{reservationManagerBean.selectedReservation.customerStatus}" />  

                        <h:outputText value="Reservation Confirmation:" />  
                        <h:outputText value="#{reservationManagerBean.selectedReservation.confirmation}" />  

                        <h:outputText value="Deposite:" />  
                        <h:outputText value="#{reservationManagerBean.selectedReservation.deposit}" />  

                        <h:outputText value="Special Request:" />  
                        <h:outputText value="#{reservationManagerBean.selectedReservation.specialRequest}" />  

                        <h:outputText value="Paid or Not:" />  
                        <h:outputText value="#{reservationManagerBean.selectedReservation.paid}" />  

                        <h:outputText value="Date Reserved:" />  
                        <h:outputText value="#{reservationManagerBean.selectedReservation.dateReserved}" /> 

                        <h:outputText value="Time Begin:" />  
                        <h:outputText value="#{reservationManagerBean.selectedReservation.timeBegin}" />  

                        <h:outputText value="Time End:" />  
                        <h:outputText value="#{reservationManagerBean.selectedReservation.timeEnd}" />  

                        <h:outputText value="Number of People:" />  
                        <h:outputText value="#{reservationManagerBean.selectedReservation.noOfPeople}" />  
                    </h:panelGrid>  
                </p:dialog>  
            </h:form> 
        </h:body>
    </ui:define>
</ui:composition>
